package net.wanho.controller;

import lombok.RequiredArgsConstructor;
import net.wanho.dto.LoginUserDto;
import net.wanho.service.LoginService;
import net.wanho.vo.AjaxResult;
import net.wanho.vo.LoginUserVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class LoginController {

    private final LoginService loginService;
    @PostMapping("/login")
    public AjaxResult login(@RequestBody LoginUserDto loginUserDto) {
        LoginUserVo loginUserVo =loginService.login(loginUserDto);
        return AjaxResult.success(loginUserVo);
    }
}
